

const app = getApp()
var httpClient = require("../../../utils/HttpClient.js");
Page({
  data: {
    StatusBar: app.globalData.StatusBar,
    CustomBar: app.globalData.CustomBar,
    detail: {},
  },

  onLoad: function(option) {
    

    httpClient.superAjax({
      isWebService: true,
      url: 'F0904Service.asmx/getSingleMin',
      data: {
        innerid: option.innerid,
        _this: this
      },
      success: function(data) {

        var d = data[0];
        d.OrderTime = d.OrderTime.substr(0, 19).replace('T', ' ');
        d.DealTime = d.DealTime.substr(0, 19).replace('T', ' ');
        d.Location = '经纬度：' + d.Location;
        d.OrderStatus = d.OrderStatus == 30 ? '完成' : '已确认';
        this.data._this.setData({
          'detail': d
        });
      }
    })
  },
  submit: function (e) {
    httpClient.superAjax({
      isWebService: true,
      showWarnAlert: true,
      operateType: '提交',
      url: 'CommonMethods.asmx/UploadConfirmOrderMin',
      data: {
        innerid: this.data.detail.InnerId,
        confirmtype: "URGENT", //困人救援:TREAT,故障保修: URGENT ,保养工单:MAINTAIN 
        filename: "",
        note: "",
        image: "",
        filetype: "",
        _this: this
      },
      success: function (data) {
        var result = '操作失败';
        if (data.length > 0 && data[0].Code == 200) {
          result = '操作成功';
        }
        wx.showToast({
          icon: 'none',
          title: result,
          success: function () {
            setTimeout(function () {
              wx.navigateBack({
                delta: 1
              })
            }, 700) //延迟时间 
          }
        })
      }
    })
  },
   
})









